package com.motu.monstercity.server.game.logic;

import com.motu.monstercity.server.game.userdata.UserActConvention;
import com.motu.monstercity.server.game.userdata.UserActConventionTask;
import com.motu.vertx.module.utility.model.EntityManager;
import com.motu.vertx.module.utility.model.Model;

import java.util.ArrayList;
import java.util.List;

public class ActConventionUserData extends ActConventionBaseData {
    public static UserActConvention getUserActConvention(long userId) {
        return (UserActConvention) EntityManager.getUniqueEntity(UserActConvention.class, userId);
    }

    public static UserActConventionTask getUserActConventionTask(long userId, int taskId) {
        return (UserActConventionTask) EntityManager.getEntity(UserActConventionTask.class, userId, taskId);
    }

    public static List<UserActConventionTask> getUserActConventionTaskList(long userId) {
        List<Model> modelList = EntityManager.getEntityList(UserActConventionTask.class, userId);
        List<UserActConventionTask> userActConventionTasks = new ArrayList<>();
        for (Model model : modelList) {
            userActConventionTasks.add((UserActConventionTask) model);
        }
        return userActConventionTasks;
    }
}
